﻿using System.ComponentModel.DataAnnotations;
using AnQinFrameWorkAPI.Common.Enum;

namespace AnQinFrameWorkAPI.Entity.SystemCore.DTO.CodeRule;

/// <summary>
///     编码规则子单更新模型
/// </summary>
public class CodeRuleItemUpdateDTO
{
    /// <summary>
    ///     排序
    /// </summary>
    [Required(ErrorMessage = "排序不可为空")]
    public int Order { get; set; }

    /// <summary>
    ///     编码类型
    /// </summary>
    [Required(ErrorMessage = "编码类型不可为空")]
    public SystemCoreEnum.CodeTypeEnum CodeType { get; set; }

    /// <summary>
    ///     常量值
    /// </summary>
    public string? Constant { get; set; }

    /// <summary>
    ///     时间类型
    /// </summary>
    public SystemCoreEnum.DateTypeEnum? DateType { get; set; }

    /// <summary>
    ///     流水号长度
    /// </summary>
    public int? SerialLength { get; set; }

    /// <summary>
    ///     流水号初始值
    /// </summary>
    public int? InitSerialNumber { get; set; }

    /// <summary>
    ///     当前流水号
    /// </summary>
    public int? CurrentSerialNumber { get; set; }

    /// <summary>
    ///     流水号刷新规则
    /// </summary>
    public SystemCoreEnum.RefreshDateTypeEnum? SerialRefreshDateType { get; set; }

    /// <summary>
    ///     上次刷新时间
    /// </summary>
    public DateTime? LastRefreshTime { get; set; }
}